# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
pkgname=plasma-mobile
pkgver=5.27.10
pkgrel=0
pkgdesc="Modules providing phone functionality for Plasma"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://www.plasma-mobile.org/"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
depends="
	breeze-icons5
	dbus-x11
	kactivities5
	kde-cli-tools
	kpipewire
	maliit-keyboard
	plasma-nano
	plasma-nm-mobile
	plasma-pa
	plasma-settings
	plasma-workspace
	qqc2-breeze-style
	qt5-qtquickcontrols2
	"
makedepends="
	extra-cmake-modules
	kactivities5-dev
	kauth5-dev
	kbookmarks5-dev
	kcodecs5-dev
	kcompletion5-dev
	kconfig5-dev
	kconfigwidgets5-dev
	kcoreaddons5-dev
	kdbusaddons5-dev
	kdeclarative5-dev
	ki18n5-dev
	kio5-dev
	kirigami-addons-dev
	kitemviews5-dev
	kjobwidgets5-dev
	knotifications5-dev
	kpackage5-dev
	kpeople5-dev
	kservice5-dev
	kwayland5-dev
	kwidgetsaddons5-dev
	kwin-dev
	kwindowsystem5-dev
	kxmlgui5-dev
	libphonenumber-dev
	modemmanager-qt5-dev
	networkmanager-qt5-dev
	plasma-framework5-dev
	plasma-workspace-dev
	qt5-qtdeclarative-dev
	samurai
	solid5-dev
	telepathy-qt-dev
	"

provides="plasma-phone-components=$pkgver-r$pkgrel" # For backwards compatibility
replaces="plasma-phone-components" # For backwards compatibility

subpackages="$pkgname-lang"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
_repo_url="https://invent.kde.org/plasma/plasma-mobile.git"
source="https://download.kde.org/$_rel/plasma/$pkgver/plasma-mobile-$pkgver.tar.xz"
options="!check" # No tests

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
ccd88e89137eca3d0a03f771be48b033a96d4c13ac174c4cdd94e83c6aaf1f424f68f0ca99a15f2ea1c5c7b4b99d6297dde3ba34018411be6424969aa9941684  plasma-mobile-5.27.10.tar.xz
"
